package com.tensquare.search.pojo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;

import java.io.Serializable;

/**
 * @author Macross
 * @Type Article.java
 * @Desc 文章实体类
 * @date 2019/12/19 14:40
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "tensquare",type = "article")
@ApiModel(value = "文章实体类",description = "ES中的实体类")
public class Article implements Serializable {

    @Id
    @ApiModelProperty(value = "文章id")
    private String id;

    @Field(analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    @ApiModelProperty(value = "文章标题")
    private String title;

    @Field(analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    @ApiModelProperty(value = "文章内容")
    private String content;

    @ApiModelProperty(value = "审核状态")
    private String state;

}
